<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
<div class="container-fluid">
  <form name="Form" id="form" #prForm="ngForm" novalidate>
    <label class="stepDesc">This step lets you select the single source of truth for data quality comparision with a
      target source.</label>
    <div class="container-fluid">
      <div class="col-md-4 col-lg-4 col-sm-4 select-schema">
        <fieldset>
          <legend>Please select schema</legend>
          <input #schemaSearchBox id="schemaSearchBox" type="text" class="search-query" placeholder="Search..."
                 (keyup.enter)="onSearch(schemaSearchBox.value)">
          <tree-root [nodes]="step1.nodeList" [options]="options"></tree-root>
        </fieldset>
      </div>
      <div class="col-md-8 col-lg-8 col-sm-8">
        <fieldset>
          <legend>
            Select attributes
          </legend>
          <div class="y-scrollable">
            <div style="margin-top:10px;">
              <label>View schema:</label>
              <i style="color:#fff;font-weight: bold;">{{step1.currentDBStr}}{{step1.currentTable}}
              </i>
            </div>
            <div style="margin-top:5px;">
              <table class="table table-striped no-border">
                <thead>
                <tr style="background-color:#7D95CC">
                  <th>
                    <input type="checkbox" (click)="toggleAll()" [checked]="selectedAll"/>
                  </th>
                  <th>Column Name</th>
                  <th>Type</th>
                  <th>Comment</th>
                </tr>
                </thead>
                <tbody>
                <tr *ngIf="!step1.schemaCollection || step1.schemaCollection.length == 0">
                  <td colspan="5" style="text-align:center;"><span class="highlight">Please select a schema from the left tree first</span>
                  </td>
                </tr>
                <tr *ngFor="let row of step1.schemaCollection">
                  <td>
                    <input type="checkbox" (click)='toggleSelection(row)' [checked]="row.selected" value={{row.name}}/>
                  </td>
                  <td>{{row.name}}</td>
                  <td>{{row.type}}</td>
                  <td>{{row.comment}}</td>
                </tr>
                </tbody>
              </table>
            </div>
          </div>
        </fieldset>
      </div>
    </div>
  </form>

  <div class="form-group btn-container">
    <button class="btn btn-primary btn-o next-step btn-wide pull-right" (click)="nextChildStep()">
      Next <i class="fa fa-arrow-circle-right"></i>
    </button>
  </div>
</div>
